package cn.fabrice.service;

import cn.fabrice.dto.UserLoginDTO;
import cn.fabrice.dto.UserQueryDTO;
import cn.fabrice.model.User;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
* @author wangwenhui
* @description 针对表【user(用户表 )】的数据库操作Service
* @createDate 2024-03-06 23:59:12
*/
public interface UserService extends IService<User> {

    /**
     * 用户注册
     * @return
     */
    Long userRegister(String account,String password,String checkPassword);

    /**
     * 用户登录
     * @param account
     * @param password
     * @return
     */
    User userLogin(String account, String password, HttpServletRequest request);

    /**
     * 动态查询
     * @param userQueryDTO
     * @return
     */
    List<User> searchPage(UserQueryDTO userQueryDTO);

    /**
     * 根据id删除
     * @param id
     * @return
     */
    boolean deleteById(Long id);

    /**
     * 用户脱敏
     * @param user
     * @return
     */
    User getSafetyUser(User user);

    /**
     * 用户退出
     * @param request
     * @return
     */
    Integer userLogout(HttpServletRequest request);

}
